/**
 * 
 */
package com.runningfox.humor;

import android.graphics.Bitmap;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;

/**
 * @author luhaiyang
 *
 */
public class ImageLayerCtrl implements OnSeekBarChangeListener, OnClickListener {
	Humor callback;
	public Bitmap bitmap;
	/**
	 * @param callback
	 */
	public ImageLayerCtrl(Humor callback) {
		super();
		this.callback = callback;
	}
	@Override
	public void onProgressChanged(SeekBar seekBar, int progress,
			boolean fromUser) {
		// TODO Auto-generated method stub
		float scale = 1;
		if(progress<50){
			scale = ((float)(progress)/50);
		}else if(progress==50){
			scale =1;
		}else if(progress>50){
			scale = ((float)(100+progress)/100);
		}
		if(scale>0){
			callback.actionUpdateImageScale(scale, scale);
		}
	}
	@Override
	public void onStartTrackingTouch(SeekBar seekBar) {
		// TODO Auto-generated method stub
	}
	@Override
	public void onStopTrackingTouch(SeekBar seekBar) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
//		if(v==callback.imgZoom){
//			this.callback.actionActiveDetailLayer();
//		}
	}
	
}
